package com.ws.soa.consumer.common.enums;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public enum SmsActionEnum {

    SEND_SMS(1, "SendSms", "发送短信");

    private int code;

    private String desc;

    private String val;

    SmsActionEnum(int code, String val, String desc) {
        this.code = code;
        this.desc = desc;
        this.val = val;
    }

    public static final SmsActionEnum getStatusByCode(int code) {
        SmsActionEnum bizEnum = enumMap.get(code);
        if (null != bizEnum) {
            return bizEnum;
        }
        return null;
    }

    private static Map<Integer, SmsActionEnum> enumMap = null;

    static {
        Map<Integer, SmsActionEnum> tempMap = new HashMap<Integer, SmsActionEnum>();

        for (SmsActionEnum item : SmsActionEnum.values()) {
            tempMap.put(item.getCode(), item);
        }
        enumMap = Collections.unmodifiableMap(tempMap);
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getVal() {
        return val;
    }
}
